/**
 * 
 */
package com.fw.timesheet.service;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.fw.timesheet.dao.BaseDAO;

/**
 * @author sigit <br>
 * @version 1.0 <br>
 * Application : Timesheet <br>
 * Copyright (c) fastwire-group 2011 <br>
 * <br>
 */
public abstract class BaseService {
    
	protected final Log log = LogFactory.getLog(this.getClass());
	
    private BaseDAO daoObject;
	
	/**
	 * @return Returns the daoObject.
	 */
	public BaseDAO getDaoObject() {
		if (daoObject == null) {
			log.error("@Timesheet>DAO object is null. Check your dao class configuration.'");
		}
		return daoObject;
	}

	/**
	 * @param daoObject
	 */
	public void setDaoObject(BaseDAO daoObject) {
		this.daoObject = daoObject;
	}
	
	/**
	 * Save action.
	 *
	 */
	public void saveAction(Object instance) {
		this.daoObject.saveOrUpdate(instance);
	}
}
